The present invention relates generally to improved processing of barcode information. More particularly, the invention relates to the advantageous methods and apparatus for determining thresholds for processing of the barcode data to detect transitions in the barcode data.
A barcode signal is typically produced by passing or scanning a laser beam across a barcode. The barcode scatters the light from the laser beam onto a lens or mirror which focuses the light onto a photodetector. The photodetector converts the eight into a photocurrent signal. The light falling on the photodetector varies due to modulation by the varying reflectivity of the light and dark bars which make up the barcode. The photocurrent signal changes during the scanning process because the laser passes through light and dark regions as it passes across the barcode, causing variations in the intensity of the light falling on the photodetector. The photocurrent signal thus provides a representation of the regions of lightness and darkness of the barcode, and can be processed to identify logic transitions represented by the barcode.
In a typical barcode scanner, the photocurrent is at a low level while the laser beam is passing over bars and climbs to a high level as the laser beam leaves the bar and passes to a white area. While the laser beam passes over the white area, the photocurrent remains at a high level and as the beam leaves the white area and reaches a bar, the photocurrent descends to a low level. These changes in the level of the photocurrent are processed in order to identify corresponding transitions in the barcode.
In order to help provide for clear identification of transitions between barcode regions, the photocurrent signal is converted into voltage variations, amplified and filtered. A low pass filter is used in order to reduce high frequency noise. The signal is then fed into a series of circuits which produce a first derivative, an inverted first derivative, a second derivative and an inverted second derivative. Peaks and troughs of the first derivative are used to represent upward and downward transitions of the photocurrent signal. The peak and trough are compared to appropriate positive and negative thresholds. If a peak is higher than the positive threshold, the second derivative will be examined for a zero crossing. If a zero crossing is present, a logic state transition from 0 to 1 is identified. Similarly, if a trough is lower than the negative threshold, the second derivative is examined for a zero crossing. If a zero crossing is present, a logic state transition from 1 to 0 is identified.
In typical prior art systems, analog circuitry is used to process the photocurrent signal. Prior art analog systems are able to perform fast processing, and present day scanning systems produce a photocurrent which requires the fast processing which is furnished by analog systems. In the prior art, analog systems have typically been required for sufficiently fast processing at a reasonable cost.
However, there are several disadvantages associated with the use of analog circuitry for processing. Barcode labels differ widely in their characteristics, and because a single scanning station may be required to process many different barcodes, signals with widely varying characteristics may be produced by the same scanner. For example, different signals produced by the same scanner may have different noise characteristics such that it would be advantageous to provide different filtering for different signals. However, in analog systems, filter characteristics cannot be changed without a change of hardware, typically discrete components such as resistors and capacitors having values chosen to provide the desired filtering. Moreover, analog filters introduce phase distortion to the signal, and operational amplifiers, which are most commonly used to provide filtering in analog barcode processing systems, are relatively expensive. Analog barcode processing systems typically require operational amplifiers in sufficient quantities to add significantly to the cost of the system. Furthermore, analog circuitry is limited in the threshold values and characteristics which can be used. It is possible to compensate for this limitation by implementing a dual threshold system, but this approach also adds to the cost of the system.
Another drawback to analog processing of barcodes is that such systems typically require a number of discrete analog components, which adds significantly to the cost and complexity of the system. Moreover, analog systems lack the flexibility to make quick and convenient adjustments to the characteristics of the system, such as the ability to divide a signal into multiple channels or the ability to provide multiple thresholds. The lack of ability to provide multiple thresholds represents a particular challenge for analog systems, because it is difficult to recover the transition edge of a narrow bar or space that follows a wide bar or space. The large bar or space raises the threshold to a high level, and the peaks generated by the narrow bar or space may be lost because they do not meet the threshold value which has been generated by the presence of the wide bar or space.
Still another limitation is that comparators typically used in an analog system have an offset voltage, which is a minimum recognizable difference between inputs, that is, between the input signal and the threshold signal. This offset voltage limits the ability of an analog system to process very small signals. If the photocurrent signal and threshold signal are amplified sufficiently to meet the offset voltage requirement, distortion may be introduced because the amplification may cause the signals to become nonlinear.
There exists, therefore, a need in the art for a barcode processing system which allows flexibility in operation including variable filtering and thresholds, which does not introduce phase distortion, and which is capable of processing small signals.
A barcode processing system according to the present invention includes a photodetector which produces a photocurrent signal. The photocurrent signal is passed to an amplifier, which may include an automatic gain control circuit in order to insure that the amplified signal possesses enough vertical resolution to allow for the processing of small signals. The amplified signal may be subjected to analog differentiation to produce a first derivative signal. The signal is digitized with an analog to digital converter to produce a digitized signal. The analog to digital converter takes samples of the first derivative signal in order to construct a digital representation of the signal. It measures the signal level and assigns a digital value that is a multiple of the smallest digital increment, 2xe2x88x92N, where N is the number of output bits of the ADC. The ADC must have a sufficient number of bits of output, and must sample at a sufficient rate, to reduce errors to an acceptable level. The allowable error is preferably less than 5% of the width of the narrowest bar or space of a barcode. The digitized signal is then processed using a digital processor such as an application specific integrated circuit (ASIC) to recover barcode information.
The digital first derivative signal is filtered using a Gaussian filter and differentiated to form a digital second derivative signal. At the same time the digital second derivative signal is created, the digital first derivative signal is analyzed to create a positive and negative threshold in order to compare peaks of the digital first derivative signal against the threshold values. The threshold has a base DC component and an additional AC component. The AC component varies with the digital first derivative signal. If the digital first derivative signal has larger peaks, the AC component of the threshold is larger, and if the digital first derivative signal has smaller peaks, the AC component of the threshold is smaller. The negative threshold may be created by multiplying the positive threshold by negative one. If desired, however, the positive and the negative threshold may be created independently, with the AC component of the positive threshold being set dependent on the positive peaks of the digital first derivative signal and the AC component of the negative threshold being set dependent on the negative peaks of the digital first derivative signal. This approach improves the sensitivity of the system and makes it less likely that a peak will improperly fail to meet the threshold.
Logic transitions are identified by evaluating the digital first derivative signal and the digital second derivative signal. If a peak of the digital first derivative signal exceeds the threshold and a corresponding zero crossing is detected in the digital second derivative signal, a logic transition is recognized. In order for a logic transition to be recognized, the zero crossing must be detected within a predetermined time window of the detection of the peak exceeding the threshold, with the time window being defined according to the sampling rate of the ADC.
A more complete understanding of the present invention, as well as further features and advantages of the invention, will be apparent from the following Detailed Description and the accompanying drawings. An important aspect of the present invention is that it provides a more flexible and adaptable approach to barcode signal processing, and while exemplary advantages are discussed herein, others will be apparent to those of skill in the art.